ArchiveoldGrid = Ext.extend(RockyGridCurd, {	
	title : "历史档案查询",
	//layout : "fit",
	//region : "center",
	baseUrl : 'archive.action',	
	winCfg : {
		height : 360,
		width : 360,
		maximizable : true,
		title : "详细信息"
	},	
	conciseMode : true,
	trackMouseOver : false,
	loadMask:false, 
	autoWidth : false,		
	autoScroll:true,
	closable : true,	
	viewConfig : {
		forceFit : false
	},
	win :null, 
	fp : null,
	constructor:function(config){
		Ext.apply(this,config);
		var sm = new Ext.grid.CheckboxSelectionModel();	
		var cmpId = this.id;
		this.cm = new Ext.grid.ColumnModel([
				new Ext.grid.RowNumberer(),
				sm,
				{						
					header : "id_archive",
					sortable : true,
					width : 80,						
					dataIndex : "id"	
				},{	
					header : "family_id",
					sortable : true,
					width : 80,						
					dataIndex : "familyid"	
				},{						
					header : "家庭编号",
					sortable : true,
					width : 80,						
					dataIndex : "familycode"		
				},{					
					header : "户主姓名",
					sortable : true,
					width : 80,					
					dataIndex : "householdername"		
				},{
					header : "所在地区",
					sortable : true,
					width : 150,					
					dataIndex : "familyarea"		
				},{
					header : "家庭地址",
					sortable : true,
					width : 200,					
					dataIndex : "familyarea"		
				},{					
					header : "建基面积",
					sortable : true,
					width : 80,					
					dataIndex : "foundationArea"						
				},{		
					header : "建筑面积",
					sortable : true,
					width : 80,					
					dataIndex : "constructionArea"
				},{
					header : "土地号",
					sortable : true,
					width : 80,					
					dataIndex : "areanum"		
				},{					
					header : "土地证号",
					sortable : true,
					width : 80,					
					dataIndex : "areacard"						
				},{		
					header : "审批表号",
					sortable : true,
					width : 80,					
					dataIndex : "autonum"
		
				},{		
					header : "查看档案",
					sortable : true,					
					renderer:function(v,r){return "<a href='#' >查看档案</a>"},
					dataIndex : "archive_id"
				}]);
		this.cm.defaultSortable = true;
		this.store = new Ext.data.JsonStore( {
			id : "id",
			url :  'archive.action',
			baseParams:{cmd:'read',suc:'archivereadold',limit:'20'},
			root : "data",
			totalProperty : "rowCount",
			remoteSort : false,
			fields : ["familyid","familycode","familyarea","householdername","areacard","areanum","autonum","constructionArea","createTime","creator","deleted","description","familyJson","foundationArea","id","keyword","latest","memo","modifier","modifyIp","modifyTime","owntype","password","showindex","snapTime","status","type","useful","username"]
		});
		this.yearStore = new Ext.data.JsonStore( {
			autoLoad:true,
			remoteSort : false,
			id : "id",
			url : 'archivingConfig.action',
			baseParams:{cmd:'read'},
			root : "data",
			totalProperty : "rowCount",
			remoteSort : false,
			fields : ["id","year"],
			listeners:{
				load:function(store, records, options){			
//			    	store.insert(0,new Ext.data.Record({'id':'-1','year':'请选择存档年份'}, '-1'));
			    	this.yearFilter.setValue('请选择存档年份');			    	   	
				},
				scope:this
			}
		}); 
		this.yearFilter = new Ext.form.ComboBox( { // select
			fieldLabel : 'select',
			editable : true,
			triggerAction : 'all',		
			valueField : 'year',
			displayField : 'year',
			mode : 'local',		
			store : this.yearStore
		});		
		ArchiveoldGrid.superclass.constructor.call(this, {
			sm: sm,
			cm : this.cm,
			store : this.store,
			viewConfig: {
				forceFit: true
			},		
			tbar : ['   ', {
				text : '刷新',
				iconCls:'refresh',
				pressed : false,
				handler : this.refresh,
				scope : this
			}, 
			new Ext.Toolbar.Fill(), 
			'请选择存档年份: ', this.yearFilter,'请输入关键字: ',
			{
				xtype : "textfield",
				width : 100,		
				scope : this
			}, {
				text : '查询',	
				iconCls:'search',
				handler : this.search,
				scope : this
			}, {
				text : '重置',
				iconCls:'cancel',
				pressed : true,
				handler : this.onReset,						
				scope : this				
			}, '   '],
			bbar : new Ext.PagingToolbar( {
				pageSize : 20,
				store : this.store,
				displayInfo : true,
				displayMsg : '显示{0}-{1}，共{2}条记录',
				emptyMsg : "没有可显示的记录！"
			})
		});
		//this.store.load();		
	},
	edit : function() {
		return false;
	}
});